Drop GtkStack:homogeneous
authorMatthias Clasen <mclasen@redhat.com>
Tue, 28 Apr 2020 23:53:33 +0000 (19:53 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 29 Apr 2020 00:00:12 +0000 (20:00 -0400)
We have hhomogeneous and vhomogeneous properties
that can be set individually.

Fixes: #2673
docs/reference/gtk/gtk4-sections.txt
gtk/gtkemojicompletion.c
gtk/gtkshortcutssection.c
gtk/gtkshortcutswindow.c
gtk/gtkstack.c
gtk/inspector/window.ui

index 5e6770183690fe59b38c7aa3068cce75bbeb7cf0..bb3488926e61e21d89f2b2001f96a80ec58d2cf6 100644 (file)
@@ -5626,8 +5626,6 @@ gtk_stack_get_visible_child
 gtk_stack_set_visible_child_name
 gtk_stack_get_visible_child_name
 gtk_stack_set_visible_child_full
-gtk_stack_set_homogeneous
-gtk_stack_get_homogeneous
 gtk_stack_set_hhomogeneous
 gtk_stack_get_hhomogeneous
 gtk_stack_set_vhomogeneous
index 11a1946e27a9078ac90307783fbfcb930ee96d2e..810d6c17292648c984961bcf42732e299f257929 100644 (file)
@@ -509,7 +509,8 @@ add_emoji (GtkWidget          *list,
   g_object_set_data (G_OBJECT (child), "base", label);
 
   stack = gtk_stack_new ();
-  gtk_stack_set_homogeneous (GTK_STACK (stack), TRUE);
+  gtk_stack_set_hhomogeneous (GTK_STACK (stack), TRUE);
+  gtk_stack_set_vhomogeneous (GTK_STACK (stack), TRUE);
   gtk_stack_set_transition_type (GTK_STACK (stack), GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT);
   gtk_container_add (GTK_CONTAINER (box), stack);
   g_object_set_data (G_OBJECT (child), "stack", stack);
index 337ece2539aca2221c76e65c23c3fae29c2091b1..348889996a9de551215c2cb5c52f3de8b661b29a 100644 (file)
@@ -418,7 +418,8 @@ gtk_shortcuts_section_init (GtkShortcutsSection *self)
   gtk_box_set_spacing (GTK_BOX (self), 22);
 
   self->stack = g_object_new (GTK_TYPE_STACK,
-                              "homogeneous", TRUE,
+                              "hhomogeneous", TRUE,
+                              "vhomogeneous", TRUE,
                               "transition-type", GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT,
                               "vexpand", TRUE,
                               "visible", TRUE,
index a2d580f0ebc2caa53a8980ea3e32acc213c923c3..935c0c3c741416395d0340335eeab92cec758571 100644 (file)
@@ -913,7 +913,8 @@ gtk_shortcuts_window_init (GtkShortcutsWindow *self)
   priv->stack = g_object_new (GTK_TYPE_STACK,
                               "hexpand", TRUE,
                               "vexpand", TRUE,
-                              "homogeneous", TRUE,
+                              "hhomogeneous", TRUE,
+                              "vhomogeneous", TRUE,
                               "transition-type", GTK_STACK_TRANSITION_TYPE_CROSSFADE,
                               NULL);
   gtk_container_add (GTK_CONTAINER (priv->main_box), GTK_WIDGET (priv->stack));
index 2efdd2be0694ceed07dcc5cfe11723fb3189e371..d2f455af6504bc591d80e934b13c8bd089ab5520 100644 (file)
@@ -163,7 +163,6 @@ G_DEFINE_TYPE_WITH_CODE (GtkStack, gtk_stack, GTK_TYPE_CONTAINER,
                                                 gtk_stack_buildable_interface_init))
 enum  {
   PROP_0,
-  PROP_HOMOGENEOUS,
   PROP_HHOMOGENEOUS,
   PROP_VHOMOGENEOUS,
   PROP_VISIBLE_CHILD,
@@ -641,9 +640,6 @@ gtk_stack_get_property (GObject   *object,
 
   switch (property_id)
     {
-    case PROP_HOMOGENEOUS:
-      g_value_set_boolean (value, gtk_stack_get_homogeneous (stack));
-      break;
     case PROP_HHOMOGENEOUS:
       g_value_set_boolean (value, gtk_stack_get_hhomogeneous (stack));
       break;
@@ -687,9 +683,6 @@ gtk_stack_set_property (GObject     *object,
 
   switch (property_id)
     {
-    case PROP_HOMOGENEOUS:
-      gtk_stack_set_homogeneous (stack, g_value_get_boolean (value));
-      break;
     case PROP_HHOMOGENEOUS:
       gtk_stack_set_hhomogeneous (stack, g_value_get_boolean (value));
       break;
@@ -738,11 +731,6 @@ gtk_stack_class_init (GtkStackClass *klass)
   container_class->remove = gtk_stack_remove;
   container_class->forall = gtk_stack_forall;
 
-  stack_props[PROP_HOMOGENEOUS] =
-      g_param_spec_boolean ("homogeneous", P_("Homogeneous"), P_("Homogeneous sizing"),
-                            TRUE,
-                            GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
-
   /**
    * GtkStack:hhomogeneous:
    *
@@ -1570,73 +1558,6 @@ gtk_stack_page_get_child (GtkStackPage *page)
   return page->widget;
 }
 
-/**
- * gtk_stack_set_homogeneous:
- * @stack: a #GtkStack
- * @homogeneous: %TRUE to make @stack homogeneous
- *
- * Sets the #GtkStack to be homogeneous or not. If it
- * is homogeneous, the #GtkStack will request the same
- * size for all its children. If it isn't, the stack
- * may change size when a different child becomes visible.
- *
- * Homogeneity can be controlled separately
- * for horizontal and vertical size, with the
- * #GtkStack:hhomogeneous and #GtkStack:vhomogeneous.
- */
-void
-gtk_stack_set_homogeneous (GtkStack *stack,
-                           gboolean  homogeneous)
-{
-  GtkStackPrivate *priv = gtk_stack_get_instance_private (stack);
-
-  g_return_if_fail (GTK_IS_STACK (stack));
-
-  homogeneous = !!homogeneous;
-
-  if ((priv->hhomogeneous && priv->vhomogeneous) == homogeneous)
-    return;
-
-  g_object_freeze_notify (G_OBJECT (stack));
-
-  if (priv->hhomogeneous != homogeneous)
-    {
-      priv->hhomogeneous = homogeneous;
-      g_object_notify_by_pspec (G_OBJECT (stack), stack_props[PROP_HHOMOGENEOUS]);
-    }
-
-  if (priv->vhomogeneous != homogeneous)
-    {
-      priv->vhomogeneous = homogeneous;
-      g_object_notify_by_pspec (G_OBJECT (stack), stack_props[PROP_VHOMOGENEOUS]);
-    }
-
-  if (gtk_widget_get_visible (GTK_WIDGET(stack)))
-    gtk_widget_queue_resize (GTK_WIDGET (stack));
-
-  g_object_notify_by_pspec (G_OBJECT (stack), stack_props[PROP_HOMOGENEOUS]);
-  g_object_thaw_notify (G_OBJECT (stack));
-}
-
-/**
- * gtk_stack_get_homogeneous:
- * @stack: a #GtkStack
- *
- * Gets whether @stack is homogeneous.
- * See gtk_stack_set_homogeneous().
- *
- * Returns: whether @stack is homogeneous.
- */
-gboolean
-gtk_stack_get_homogeneous (GtkStack *stack)
-{
-  GtkStackPrivate *priv = gtk_stack_get_instance_private (stack);
-
-  g_return_val_if_fail (GTK_IS_STACK (stack), FALSE);
-
-  return priv->hhomogeneous && priv->vhomogeneous;
-}
-
 /**
  * gtk_stack_set_hhomogeneous:
  * @stack: a #GtkStack
index 4fc07bcfc8899c479279133c40163c8fb1fa67dd..e469cb23c27afd373786b52c9292070dee1f31e2 100644 (file)
                                     </child>
                                     <child>
                                       <object class="GtkStack" id="object_start_stack">
-                                        <property name="homogeneous">0</property>
+                                        <property name="hhomogeneous">0</property>
+                                        <property name="vhomogeneous">0</property>
                                         <child>
                                           <object class="GtkStackPage">
                                             <property name="name">empty</property>
                                     <property name="transition-type">crossfade</property>
                                     <property name="hexpand">1</property>
                                     <property name="halign">center</property>
-                                    <property name="homogeneous">0</property>
+                                    <property name="hhomogeneous">0</property>
+                                    <property name="vhomogeneous">0</property>
                                     <child>
                                       <object class="GtkStackPage">
                                         <property name="name">title</property>